<template>
    <div class="top">
        <div class="left">
            <van-icon size="24px" name="wap-home-o" @click="tohomeHandler" color="black" />
        </div>
        <div class="middle">{{ props.content }}</div>
        <div class="right">
            <van-icon size="26px" name="search" color="black" class="right-left" @click="tosearchHandler"/>
            <van-icon size="26px" name="shopping-cart-o" color="black" @click="tocartHandler"/>
        </div>
    </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router';
const router = useRouter()
const tohomeHandler = () => {
    router.push('/home')

}
const tosearchHandler=()=>{
    router.push('/search')
}
const tocartHandler=()=>{
    router.push('/cart')
}
const props=defineProps({
    content:{
        type:String
    }
})
</script>

<style scoped>
.top {
    height: 44px;
    width: 375px;
    border-bottom: 1px solid #eeeeee;
    position: fixed;
    display: flex;
    align-items: center;
    justify-content:space-around;
    top:-1px;
    opacity: 1;
    background: white;

}

.left {
    height: 24px;
    width: 24px;
    position: relative;
    top: 0;
    left:-20px;
}

.middle {

    height: 24px;
    font-size: 16px;
    line-height: 24px;
}

.right {
    margin-right: -20px;
    height: 24px;
    width: 55px;
    display: flex;
    top: 0;
}
.right-left{
    margin-right: 5px;
}
*{
    margin: 0;
    padding: 0;
}
</style>